package com.wangsd.common.component.extBean;

import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;

/**
 * 添加、删除分账接收方（返回）
 */
@XStreamAlias("xml")
public class PaymentReceiverResponse extends BaseWxPayResult {

    @XStreamAlias("receiver")
    private String receiver;

    public static PaymentReceiverResponse fromXML(String xmlString) {
        XStream xstream = XStreamInitializer.getInstance();
        xstream.allowTypesByWildcard(new String[]{"me.chanjar.weixin.**",
                "cn.binarywang.wx.**", "com.github.binarywang.**",
                "com.wangsd.common.component.**"});
        xstream.processAnnotations(PaymentReceiverResponse.class);
        PaymentReceiverResponse result = (PaymentReceiverResponse) xstream.fromXML(xmlString);
        result.setXmlString(xmlString);
        return result;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }
}
